<script type="text/javascript">var SURVEY_ID = <?php echo isset($survey['id'])?$survey['id']:"0"?>;</script>
<script type="text/javascript">var SURVEY_DATA = <?php echo json_encode($survey);?></script>
<style>
.hide{display: none;}
.oscore{width: 20px;}
.qname,.oname{border: none;}
.oscore{border: none;text-align: center;}
.oscore-minus,.oscore-plus{cursor: pointer;}
.bootstrap-tagsinput input{line-height: 32px;}
</style>
<!-- 
<div class="row">
    <div class="col-xs-12 col-sm-7 col-md-7 col-lg-4">
        <h1 class="page-title txt-color-blueDark">
        <i class="fa-fw fa fa-home"></i>
        首页
        <span>>
        调查管理
        </span>
        </h1>
    </div>
</div>
-->
<!-- end row -->
    
    <div class="row">
        <div class="col-xs-2">
            <div id="accordion">
                <div>
                    <h4>题目选择</h4>
                    <div class="padding-10">
                        <a href="javascript:;" class="btn btn-default btn-sm btn-block btn-question-add" data-id="radio">单选题</a>
                        <a href="javascript:;" class="btn btn-default btn-sm btn-block btn-question-add" data-id="checkbox">多选题</a>
                        <a href="javascript:;" class="btn btn-default btn-sm btn-block btn-question-add" data-id="text">单行主观</a>
                        <a href="javascript:;" class="btn btn-default btn-sm btn-block btn-question-add" data-id="textarea">多行主观</a>
                        <a href="javascript:;" class="btn btn-default btn-sm btn-block btn-question-add" data-id="answer">排序题</a>
                        <a href="javascript:;" class="btn btn-default btn-sm btn-block btn-question-add" data-id="star">量表题</a>
                        <hr>
                    </div>
                </div>

                <div>
                    <h4>调查设置</h4>
                    <div class="padding-10">
                        <a href="javascript:;" class="btn btn-default btn-xs btn-block btn-survey-info">问卷设置</a>
                        <a href="javascript:;" class="btn btn-default btn-xs btn-block btn-survey-view">外观设置</a>
                        <a href="javascript:;" class="btn btn-default btn-xs btn-block btn-survey-logic">逻辑设置</a>
                        <a href="javascript:;" class="btn btn-default btn-xs btn-block btn-survey-collect">收集设置</a>
                        <a href="javascript:;" class="btn btn-default btn-xs btn-block btn-survey-preview">预览问卷</a>
                        <a href="javascript:;" class="btn btn-default btn-xs btn-block btn-survey-publish">发布问卷</a>
                        <hr>
                    </div>
                </div>
                <div>
                    <h4>导入导出</h4>
                    <div class="padding-10">
                        <a href="javascript:;" class="btn btn-default btn-xs btn-block btn-survey-import"><i class="fa fa-cloud-upload"></i>&nbsp;导入</a>
                        <a href="javascript:;" class="btn btn-default btn-xs btn-block btn-survey-export"><i class="fa fa-cloud-download"></i>&nbsp;导出</a>
                    </div>
                </div>
            </div>


           

           

            
        </div>
        <div class="col-xs-10">
            <div id="survey_questions">
            </div>
        </div>
    </div>
<div id="dialog-survey-info" class="" style="display:none">
    <form action="" class="smart-form" style="margin:0;width:550px;">
        <section>
            <label class="label">调查标题</label>
            <label class="input">
                <input type="text" placeholder="调查标题">
            </label>
        </section>
        <section>
            <label class="label">描述信息</label>
            <label class="textarea">
                <textarea></textarea>
            </label>
        </section>
        <section>
            <label class="label">起止时间</label>
            <div class="row">
                <div class="col col-6">
                    <label class="input"> 
                        <input placeholder="结束时间" id="survey-starttime" class="datetime">
                    </label>
                </div>
                <div class="col col-6">
                    <label class="input"> 
                        <input placeholder="结束时间" id="survey-endtime" class="datetime">
                    </label>
                </div>
            </div>
        </section>
        <section>
            <label class="label">类型</label>
            <div class="row">
                <div class="col col-12">
                    <label class="checkbox">
                        <input type="checkbox" name="checkbox" checked="checked"><i></i>投票
                    </label>

                    <label class="checkbox">
                            <input type="checkbox" name="checkbox"><i></i>问卷
                    </label>

                    <label class="checkbox">
                        <input type="checkbox" name="checkbox"><i></i>问答
                    </label>

                    <label class="checkbox">
                        <input type="checkbox" name="checkbox"><i></i>测试
                    </label>
                </div>
            </div>
        </section>
        
    </form>
</div>
<div id="dialog-picture-upload" style="display:none">
    <img id="form-pic-view" src="http://mat1.gtimg.com/www/panshi/img/logo-panshi-admin.png" alt="" class="img">
    <form action="" class="smart-form">
        <input type="hidden" id="form-pic-type">
        <section>
            <label class="label">上传图片</label>
            <label for="file" class="input input-file">
                <div class="button">
                    <input id="btn-pic-upload" type="file" name="file" onchange="this.parentNode.nextSibling.value = this.value">上传图片
                </div>
                <input type="text" placeholder="图片链接" readonly="">
            </label>
        </section>
        <section>
            <label class="label">网络图片</label>
            <label class="input">
                <input id="form-pic-url" type="text" placeholder="图片链接">
            </label>
        </section>
    </form>
</div>
<div id="dialog-survey-description" style="display:none">
    <form action="" class="smart-form">
        <input type="hidden" id="form-description-type">
        <section>
            <label class="label">描述信息</label>
            <label class="textarea">
                <textarea id="form-description-content" cols="30" rows="2"></textarea>
            </label>
        </section>
    </form>
</div>
<div id="dialog-survey-setting" style="display:none">
    <form action="" class="smart-form">
        <section>
            <label class="label">发布站点</label>
            <label class="input">
                <input type="text" placeholder="发布站点域名">
            </label>
        </section>
        <section>
            <label class="label">参与方式</label>
            <label class="radio">
                <input type="radio">登录
                <input type="radio">匿名
            </label>
        </section>
        <section>
            <label class="label">参与频度</label>
            <label class="input">
                <input type="text" value="0">
            </label>
        </section>
        <section>
            <label class="label">参与周期</label>
            <label class="select">
                <select class="">
                    <option>每天</option>
                    <option>每周</option>
                </select>
            </label>
        </section>
        <section>
            <label class="label">调查结果</label>
            <label class="select">
                <select class="">
                    <option>可见</option>
                    <option>不可见</option>
                </select>
            </label>
        </section>
        
    </form>
    <form id="ansreset_form" action="/edit/ajax/ansrest/" callback="ansrest_callback">
        <input type="hidden" name="proj_id" value="539c364ff7405b742266958b">
        <input type="hidden" name="_xsrf" value="d405d534256145a381208d5c22d90b87">
        <table>
            <caption><span class="active">回答限制</span></caption>
            <tbody>
                <tr>
                    <td width="15">
                        <input type="checkbox" id="ansoncetime" name="limit_per_pc">
                    </td>
                    <td><label for="ansoncetime" class="inputlabel">每台电脑或手机只能答一次</label></td>
                </tr>
                <tr>
                    <td><input type="checkbox" id="oncetime" name="limit_per_ip"></td>
                    <td><label for="oncetime" class="inputlabel">每个IP只能答一次</label></td>
                </tr>
                <tr>
                    <td><input type="checkbox" class="enablebox" id="enablepword" name="password"></td>
                    <td class="enable"><label for="enablepword" class="inputlabel">启用访问密码</label>
                    <input type="text" id="password" name="password" class="inputborder" placeholder="请输入访问密码"></td>
                </tr>
                <tr>
                    <td><input type="checkbox" id="limitemail" name="is_email_rspd_only"></td>
                    <td><label for="limitemail" class="inputlabel">只有邮件邀请的受访者可回答</label></td>
                </tr>
            </tbody>
        </table>
        <table class="mtop">
            <caption class="title"><span class="active" id="end_time">何时结束</span><span class="perfect">以下任意一项满足时，问卷结束。</span></caption>
            <tbody>
                <tr>
                    <td width="15"><input type="checkbox" class="numberbox" id="num"></td>
                    <td>
                        <label for="num" class="inputlabel">收集</label>
                        <input type="text" class="numberinput inputborder" id="survey_count" name="survey_count">
                        <label for="num" id="num_tip" class="inputlabel">份答卷时结束</label>
                    </td>
                </tr>
                <tr>
                    <td><input type="checkbox" class="timebox" id="time"></td>
                    <td>
                        <label for="time" class="inputlabel">到</label>
                        <input type="text" class="timeinput inputS send_timeInput inputborder" id="finish_date" name="finish_date" readonly="readonly"><button type="button" class="Zebra_DatePicker_Icon Zebra_DatePicker_Icon_Inside" style="left: -21px; top: 0px;">Pick a date</button>
                        <label for="time" id="time_tip" class="inputlabel">日结束</label>
                    </td>
                </tr>
            </tbody>
        </table>
        <table class="mtop">
            <caption><span class="active">答完问卷后</span></caption>
            <tbody>
                <tr>
                    <td width="15">
                        <input type="checkbox" id="show_share_btn" name="show_share_btn">
                    </td>
                    <td><label for="show_share_btn" class="inputlabel">显示分享按钮，分享答题链接到更多社交网站</label></td>
                </tr>
                <tr>
                    <td><input type="checkbox" id="show_share_result" name="show_share_result"></td>
                    <td><label for="show_share_result" class="inputlabel">允许受访人答完问卷后查看结果</label></td>
                </tr>
            </tbody>
        </table>
        <div class="mtop alignr">
            <div id="btn_submitter" class="WJButton wj_blue smallfontsize">保存</div>
        </div>
    </form>
</div>
<div id="dialog-survey-logic" style="display:none;">
    <table id="total_jump_table">
        <tbody>
            <tr class="jump_row" new="1">
                <td>如果</td>
                <td>
                    <select name="source_q" disabled="disabled">
                        <option value="">-请选择题目-</option>
                        <option value="539c3655f7405b6d85808708">Q1:谁最漂亮</option>
                        <option value="539c4a4df7405b6e97b67b50">Q2:多项填空题</option>
                    </select>
                </td>
                <td style="text-align:center;">选择了</td>
                <td>
                    <select name="option" disabled="disabled">
                        <option value="">-请选择选项-</option>
                        <option value="539c3655f7405b6d85808709">RPP</option>
                        <option value="539c3655f7405b6d8580870a">GMM</option>
                        <option value="any">任意选项</option>
                    </select>
                </td>
                <td>则跳转到</td>
                <td>
                    <select name="jump_to" disabled="disabled">
                        <option value="">-请选择题目-</option>
                        <option value="539c4a4df7405b6e97b67b50">Q2:多项填空题</option>
                        <option value="1">提前结束（计入结果）</option>
                        <option value="2">提前结束（不计入结果）</option>
                    </select>
                </td>
                <td>
                    <div class="reduce"></div>
                </td>
            </tr>

            <tr class="add_row" style="display: table-row;">
                <td>
                    <a href="javascript:;"> <i class="add-icon-active" id="add_jump_row"></i></a>
                </td>
            </tr>
        </tbody>
    </table>
</div>
<script src="/assets/static/libs/jquery.uploadify.js"type="text/javascript"></script>
<script src="/assets/static/js/module/survey_data.js"></script>
<script src="/assets/static/js/module/survey_form.js"></script>
<script src="/assets/static/libs/bootstrap-tagsinput.min.js"></script>
<script type="text/javascript">
//$('#tabs').tabs();
var accordionIcons = {
         header: "fa fa-plus",    // custom icon class
         activeHeader: "fa fa-minus" // custom icon class
     };
     
    $("#accordion").accordion({
        autoHeight : false,
        heightStyle : "content",
        collapsible : true,
        animate : false,
        icons: accordionIcons,
        header : "h4",
    })

</script>